package de.playmee.enums;

public enum Mood {

	Angry		(0, "Angry"),
	Bored		(1, "Bored"),
	Energetic	(2, "Energetic"),
	//Tired 	(3, "Tired"),
	Happy		(4, "Happy"),
	Sad			(5, "Sad"),
	Relaxed		(6, "Relaxed"),
	Stressed	(7, "Stressed"),
	InLove		(8, "In love");

	private final int id;
	private final String s;

	private Mood(int id, String s) {
		this.id = id;
		this.s = s;
	}

	public int getId() {
		return id;
	}

	@Override
	public String toString() {
		return s;
	}
	
	/**
	 * @return array with all moods
	 */
	public static Mood[] getArray() {
		return new Mood[] { Angry, Bored, Energetic, Happy,
				Sad, Relaxed, Stressed, InLove };
	}

	/**
	 * returns the mood with the given id
	 * 
	 * @param id
	 * @return Mood
	 */
	public static Mood getById(int id) {
		for (Mood m : getArray()) {
			if (id == m.getId())
				return m;
		}
		return null;
	}

	/**
	 * returns an array with all moods needed for editing channel and track settings
	 * 
	 * @return array
	 */
	public static String[] getStringList() {
		Mood[] moods = getArray();
		String[] s = new String[moods.length];
		for (int i = 0; i < moods.length; i++) {
			s[i] = moods[i].toString();
		}
		return s;
	}
}